﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Fee.aspx.cs" Inherits="NX5Web.admin.Setting.Fee" %>


<div id="subApp">
    <div style="    margin: 50px auto;
    text-align: center;
    font-size: 14px;
    color: #777;
    line-height: 32px;">
        <div>正式课</div>
        <div>常规课 <el-input-number v-model="Remeber" :min="1"  /></div>
        <div style="margin-top:10px;">保温课 <el-input-number v-model="Review" :min="1" /></div>
        <div style="margin-top:10px;">体验课</div>
        <div>常规课 <el-input-number v-model="tasteRemeber" :min="1" /></div>
        <div style="margin-top:10px;">保温课 <el-input-number v-model="tasteReview" :min="1" /></div>

        <div style="margin-top:10px;">
            <el-checkbox v-model="AutoSettle" label="自动结算" /> 
        </div>
        <div style="margin-top:10px;" v-if="AutoSettle">
            每月结算日:<el-input-number v-model="SettleDay" :min="1" :max="31"/>
        </div>


        <div style="margin-top:10px;">
               <el-button type="primary" @click="savefee">保 存</el-button>
        </div>
    </div>
</div>


<script>
    var subApp = createApp({
        el: '#subApp',
        data() {
            return {
                Remeber: 45,
                Review: 1,
                tasteRemeber: 10,
                tasteReview: 1,
                AutoSettle: false,
                SettleDay:1
            }
        },
        computed: {
        },
        methods: { 
            savefee() {
                loaddingPlus(true);
                var user = new ktluser();
                ktlapi({
                    "action": "Cus_SetCompanyFee",
                    "data": {
                        CompanyId: new ktluser().userInfo().CompanyId,
                        RememberFee: this.Remeber,
                        ReviewFee: this.Review,
                        TasteRememberFee: this.tasteRemeber,
                        TasteReviewFee: this.tasteReview,
                        AutoSettle: this.AutoSettle?1:0,
                        SettleDay: this.SettleDay
                    }
                }).then(res => {  
                    loaddingPlus(false);
                });
            },
            init() {
                loaddingPlus(true);
                var user = new ktluser();
                ktlapi({ 
                    "action": "Cus_GetCompanyFee",
                    "data": {
                        CompanyId: new ktluser().userInfo().CompanyId
                    }
                }).then(res => {
                    if (res.data.length > 0) {
                        var baseinfo = res.data[0];
                        this.Remeber = baseinfo["RememberFee"];
                        this.Review = baseinfo["ReviewFee"];
                        this.tasteRemeber = baseinfo["TasteRememberFee"];
                        this.tasteReview = baseinfo["TasteReviewFee"];
                        this.AutoSettle = baseinfo["AutoSettle"];
                        this.SettleDay = baseinfo["SettleDay"];
                    }
                    loaddingPlus(false);
                });
            }
        },
        mounted: function () {
            this.init();
        }
    });
</script>